<template>
  <el-tabs type="border-card" @tab-click="handleClick">
    <el-tab-pane label="工程级联档案查阅">
      <new-data v-if="activeName === 'new'"></new-data>
    </el-tab-pane>
    <el-tab-pane label="案卷级联档案查阅">
      <old-data v-if="activeName === 'old'"></old-data>
    </el-tab-pane>
  </el-tabs>
</template>

<script>
  import newData from "@/views/system/search/newdata.vue";
  import oldData from "@/views/system/search/olddata.vue";

  export default {
    components: {
      newData,
      oldData,
    },
    data() {
      return {
        activeName: 'new',
      }
    },
    methods: {
      handleClick(tab) {
        if (tab.label === '工程级联档案查阅') {
          this.activeName ='new'
        } else if (tab.label === '案卷级联档案查阅') {
          this.activeName = 'old'
        }
      }
    }
  }
</script>
